<template>
  <div>
    {{exam}}
  </div>
</template>

<script>
  import {examDetail} from '@/api/api'
  export default {
    data () {
      return {
        exam: []
      }
    },
    computed: {
      defaultActive: function () {
        return 'reportList'
      }
    },
//    watch: {
//      '$route': 'initData'
//    },
    created () {
      this.initData()
    },
    methods: {
      async initData () {
        let examId = this.$route.params.examId
        try {
          examDetail(examId).then((res) => {
            this.exam = res.data
            this.loading = false
          })
        } catch (err) {
          console.log('获取数据失败', err)
        }
      }
    }
  }
</script>
